import { ActiveBaseIcon } from "../../activity/icon/ActiveBaseIcon";
import { LayerManager } from "../../../manager/LayerManager";
import { RightTopLayerLine } from "../../../manager/RightTopLayerLine";
import { RightTopLayerIndex } from "../../../manager/RightTopLayerIndex";
import { ObjCreate } from "../../common/ObjCreate";
import { ResFileConst } from "../../../resource/ResFileConst";
import { Dispatcher } from "../../../../mvc/core/Dispatcher";
import { DataEvent } from "../../../events/DataEvent";
import { EventName } from "../../../mvc/EventName";
import { EffectManager } from "../../../manager/EffectManager";
import { FilterConst } from "../../../../component/gconst/FilterConst";
import { GLoadedButton } from "../../../../../com/mui/controls/GLoadedButton";
type int = number;
//class PetCpnIconView
    
    export  class PetCpnIconView extends ActiveBaseIcon
    {
        constructor()
        {
            super();
            this.layer = LayerManager.rightTopUILayer;
            this.line = RightTopLayerLine.lineOne;
            this.index = RightTopLayerIndex.PetCpnIconView;
            this.init();
            return;
        }

        /* internal  */init(): void
        {
            this._iconBtn = ObjCreate.createGLoadedButton(ResFileConst.PetCpnIcon, 0, 0, 60, 50, this);
            this.addChild(this._iconBtn);
            this._iconBtn.addEventListener(flash.events.MouseEvent.CLICK, this.onIconBtnClick);
            return;
        }

        /* internal  */onIconBtnClick(arg1: Object /* flash.events.MouseEvent */): void
        {
            Dispatcher.dispatchEvent(new DataEvent(EventName.PetCpnOpenWindow));
            return;
        }

        /* internal  */flicker(): void
        {
            EffectManager.glowFilterReg(this._iconBtn, [FilterConst.uiBtnFilter], 1, 10, 0, 10);
            return;
        }

        public /* override */ show(arg1: int=0, arg2: int=0): void
        {
            super.show(arg1, arg2);
            this.flicker();
            return;
        }

        /* internal */ /* var */_iconBtn: GLoadedButton;
    }
